A conventional moving image encoding apparatus is designed to compress and encode a moving image signal with high efficiency by using the statistical characteristics of a moving image signal, i.e., correlations between intraframe pixels and between interframe pixels, thereby realizing a great reduction in information amount.
As basic schemes of compressing and encoding moving image signals, a predictive encoding scheme and transformational encoding scheme are available. The predictive encoding scheme uses correlations in time domains. The transformational encoding scheme uses correlations in spatial domains. As a predictive encoding scheme, a motion compensation predictive scheme of encoding a difference signal between an original image and a predicted image obtained by motion compensation prediction is known. As a transformation encoding scheme, an orthogonal transformation scheme is known, in which a frame is divided into blocks each constituting of a plurality of pixels, the respective pixel components are orthogonally transformed into components in frequency domains in units of blocks by DCT (Discrete Cosine Transform), and the orthogonal transformation coefficients (DCT coefficients) of the resultant frequency components are quantized, thereby variable-length-encoding the quantized coefficients.
In general, a moving image encoding scheme as a combination of the above motion compensation prediction scheme and orthogonal transformation scheme is used. As such a scheme, a scheme called H261 and H263 has been standardized by ITU-T (International Telecommunication Union-Telecommunication Standardization Sector), and a scheme called MPEG (Moving Picture Experts Group) has been standardized by the image compression standardization group established under ISO (International Organization for Standardization). In this MPEG scheme, encoding is defined to be performed in units of blocks called macroblocks, each consisting of 16×16 pixels.
A general moving image encoding apparatus for encoding moving image signals by using a combination of the motion compensation prediction scheme and orthogonal transformation scheme in the above manner includes an intra-encoding scheme and inter-encoding scheme as encoding modes. In the intra-encoding mode, the respective pixel components in input frames are encoded in units of macroblocks without motion compensation prediction. In the inter-encoding scheme, difference values between a motion compensation predicted image and an original image are obtained, and the resultant data are encoded in units of macroblocks.
In this case, the encoding apparatus in the inter-frame encoding mode generates decoded image data by internally decoding the data obtained by encoding a given frame A. This data is referred to as local decoded image data and stored in the frame memory. In encoding another frame B, the encoding apparatus performs motion estimation by using both the local decoded image data stored in the frame memory and the input image data, and generates a motion compensation predicted image on the basis of the estimation result. Difference values between this motion compensation predicted image and the original image are obtained, and the difference data are encoded and output to the transmission path.
The moving image decoding apparatus on the decoding side (destination) stores the decoded image data of the frame A in the frame memory as in the encoding side. Upon reception of the encoded difference data, first of all, the decoding apparatus generates a motion compensation predicted image from the decoded data of the frame A. If there is no error in the received data of the frame A, since the decoded image of the frame A matches the local decoded image of the frame A on the encoding apparatus side, as a matter of course, the motion compensation predicted image generated from this decoded data matches the motion compensation predicted image on the encoding apparatus side.
Since the encoding apparatus sends out the difference image between the original image and the motion compensation predicted image, the decoding apparatus can generate a decoded image of the frame B by adding the motion compensation predicted image to the received difference image.
The encoding apparatus generates a motion compensation predicted image by cutting data nearest to the pixel value of an input block from local decoded image data. If, therefore, the data of the frame A received by the decoding apparatus contains an error, a correct decoded image of the frame A cannot be generated. As a consequence, all images cut and generated from the error-containing portion of the motion compensation predicted image become erroneous data. If, therefore, the error-containing portion is cut as a plurality of motion compensation predicted image blocks, the error is spatially diffused. These erroneous data remain until refresh processing is performed by intra-encoding.
Same motion compensation prediction processing is performed for the next frame. As a consequence, on the decoding apparatus side, decoded images generated by using motion compensation predicted images generated from the erroneous data are stored in the frame memory and used to generate a motion compensation predicted image of the next frame. As such processing is repeated, the influences of erroneous data sequentially propagate. These erroneous data remain until refresh processing is performed by intra-encoding.
For the reasons described above, on the moving image encoding apparatus side, refresh must be periodically performed by intra-encoding to replace all the destroyed data with new image data, thus preventing the propagation of a data error. In addition, the influences of transmission encoding errors on the receiving side must be minimized.
With regard to refresh by intra-encoding, for example, according to ITU-T H.263, as the first scheme, a technique of performing refresh at least once while one macroblock is encoded 132 times is defined. To meet this definition, a technique of suppressing the propagation of a data error by cyclically refreshing a predetermined macroblock by intra-encoding is generally used.
In addition, according to MPEG-4, as the second scheme, a technique of performing refresh by aperiodically intra-encoding one macroblock is defined. In this technique, difference values between a predicted image and a current image are obtained in units of macroblocks, and macroblocks corresponding to difference values equal to or larger than a reference value are extracted as important areas that require refresh. Refresh is then sequentially performed for the macroblocks in the important areas in descending order of priority.